Image Moment
   HOME

TheInfoList



OR:

In
image processing An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensio ...
,
computer vision Computer vision is an interdisciplinary scientific field that deals with how computers can gain high-level understanding from digital images or videos. From the perspective of engineering, it seeks to understand and automate tasks that the human ...
and related fields, an image moment is a certain particular weighted average (
moment Moment or Moments may refer to: * Present time Music * The Moments, American R&B vocal group Albums * ''Moment'' (Dark Tranquillity album), 2020 * ''Moment'' (Speed album), 1998 * ''Moments'' (Darude album) * ''Moments'' (Christine Guldbrand ...
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation. Image moments are useful to describe objects after segmentation. Simple properties of the image which are found ''via'' image moments include area (or total intensity), its
centroid In mathematics and physics, the centroid, also known as geometric center or center of figure, of a plane figure or solid figure is the arithmetic mean position of all the points in the surface of the figure. The same definition extends to any ...
, and information about its orientation.


Raw moments

For a 2D continuous function ''f''(''x'',''y'') the
moment Moment or Moments may refer to: * Present time Music * The Moments, American R&B vocal group Albums * ''Moment'' (Dark Tranquillity album), 2020 * ''Moment'' (Speed album), 1998 * ''Moments'' (Darude album) * ''Moments'' (Christine Guldbrand ...
(sometimes called "raw moment") of order (''p'' + ''q'') is defined as : M_=\int\limits_^ \int\limits_^ x^py^qf(x,y) \,dx\, dy for ''p'',''q'' = 0,1,2,... Adapting this to scalar (greyscale) image with pixel intensities ''I''(''x'',''y''), raw image moments ''Mij'' are calculated by :M_ = \sum_x \sum_y x^i y^j I(x,y)\,\! In some cases, this may be calculated by considering the image as a
probability density function In probability theory, a probability density function (PDF), or density of a continuous random variable, is a function whose value at any given sample (or point) in the sample space (the set of possible values taken by the random variable) ca ...
, ''i.e.'', by dividing the above by :\sum_x \sum_y I(x,y) \,\! A uniqueness theorem (Hu
962 Year 962 ( CMLXII) was a common year starting on Wednesday (link will display the full calendar) of the Julian calendar. Events By place Byzantine Empire * December – Arab–Byzantine wars – Sack of Aleppo: A Byzantine e ...
states that if ''f''(''x'',''y'') is piecewise continuous and has nonzero values only in a finite part of the ''xy'' plane, moments of all orders exist, and the moment sequence (''Mpq'') is uniquely determined by ''f''(''x'',''y''). Conversely, (''Mpq'') uniquely determines ''f''(''x'',''y''). In practice, the image is summarized with functions of a few lower order moments.


Examples

Simple image properties derived ''via'' raw moments include: * Area (for binary images) or sum of grey level (for greytone images): M_ * Centroid: \ = \left\


Central moments

Central moments are defined as : \mu_ = \int\limits_^ \int\limits_^ (x - \bar)^p(y - \bar)^q f(x,y) \, dx \, dy where \bar=\frac and \bar=\frac are the components of the
centroid In mathematics and physics, the centroid, also known as geometric center or center of figure, of a plane figure or solid figure is the arithmetic mean position of all the points in the surface of the figure. The same definition extends to any ...
. If ''ƒ''(''x'', ''y'') is a digital image, then the previous equation becomes :\mu_ = \sum_ \sum_ (x - \bar)^p(y - \bar)^q f(x,y) The central moments of order up to 3 are: :\mu_ = M_,\,\! :\mu_ = 0,\,\! :\mu_ = 0,\,\! :\mu_ = M_ - \bar M_ = M_ - \bar M_, :\mu_ = M_ - \bar M_, :\mu_ = M_ - \bar M_, :\mu_ = M_ - 2 \bar M_ - \bar M_ + 2 \bar^2 M_, :\mu_ = M_ - 2 \bar M_ - \bar M_ + 2 \bar^2 M_, :\mu_ = M_ - 3 \bar M_ + 2 \bar^2 M_, :\mu_ = M_ - 3 \bar M_ + 2 \bar^2 M_. It can be shown that: :\mu_ = \sum_^p \sum_^q (-\bar)^(-\bar)^ M_ Central moments are translational invariant.


Examples

Information about image orientation can be derived by first using the second order central moments to construct a
covariance matrix In probability theory and statistics, a covariance matrix (also known as auto-covariance matrix, dispersion matrix, variance matrix, or variance–covariance matrix) is a square matrix giving the covariance between each pair of elements of ...
. :\mu'_ = \mu_ / \mu_ = M_/M_ - \bar^2 :\mu'_ = \mu_ / \mu_ = M_/M_ - \bar^2 :\mu'_ = \mu_ / \mu_ = M_/M_ - \bar\bar The
covariance matrix In probability theory and statistics, a covariance matrix (also known as auto-covariance matrix, dispersion matrix, variance matrix, or variance–covariance matrix) is a square matrix giving the covariance between each pair of elements of ...
of the image I(x,y) is now :\operatorname (x,y)= \begin \mu'_ & \mu'_ \\ \mu'_ & \mu'_ \end. The
eigenvector In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denoted ...
s of this matrix correspond to the major and minor axes of the image intensity, so the orientation can thus be extracted from the angle of the eigenvector associated with the largest eigenvalue towards the axis closest to this eigenvector. It can be shown that this angle Θ is given by the following formula: :\Theta = \frac \arctan \left( \frac \right) The above formula holds as long as: :\mu'_ - \mu'_ \ne 0 The
eigenvalue In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denote ...
s of the covariance matrix can easily be shown to be : \lambda_i = \frac \pm \frac, and are proportional to the squared length of the eigenvector axes. The relative difference in magnitude of the eigenvalues are thus an indication of the eccentricity of the image, or how elongated it is. The eccentricity is : \sqrt.


Moment invariants

Moments are well-known for their application in image analysis, since they can be used to derive invariants with respect to specific transformation classes. The term ''invariant moments'' is often abused in this context. However, while ''moment invariants'' are invariants that are formed from moments, the only moments that are invariants themselves are the central moments. Note that the invariants detailed below are exactly invariant only in the continuous domain. In a discrete domain, neither scaling nor rotation are well defined: a discrete image transformed in such a way is generally an approximation, and the transformation is not reversible. These invariants therefore are only approximately invariant when describing a shape in a discrete image.


Translation invariants

The central moments ''μi j'' of any order are, by construction, invariant with respect to
translations Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''transl ...
.


Scale invariants

Invariants ''ηi j'' with respect to both
translation Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''transla ...
and scale can be constructed from central moments by dividing through a properly scaled zero-th central moment: :\eta_ = \frac \,\! where ''i'' + ''j'' ≥ 2. Note that translational invariance directly follows by only using central moments.


Rotation invariants

As shown in the work of Hu,M. K. Hu, "Visual Pattern Recognition by Moment Invariants", IRE Trans. Info. Theory, vol. IT-8, pp.179–187, 1962 invariants with respect to
translation Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. The English language draws a terminological distinction (which does not exist in every language) between ''transla ...
, scale, and ''
rotation Rotation, or spin, is the circular movement of an object around a '' central axis''. A two-dimensional rotating object has only one possible central axis and can rotate in either a clockwise or counterclockwise direction. A three-dimensional ...
'' can be constructed: I_1 = \eta_ + \eta_ I_2 = (\eta_ - \eta_)^2 + 4\eta_^2 I_3 = (\eta_ - 3\eta_)^2 + (3\eta_ - \eta_)^2 I_4 = (\eta_ + \eta_)^2 + (\eta_ + \eta_)^2 I_5 = (\eta_ - 3\eta_) (\eta_ + \eta_) (\eta_ + \eta_)^2 - 3 (\eta_ + \eta_)^2+ (3 \eta_ - \eta_) (\eta_ + \eta_) 3(\eta_ + \eta_)^2 - (\eta_ + \eta_)^2 I_6 = (\eta_ - \eta_) \eta_ + \eta_)^2 - (\eta_ + \eta_)^2+ 4\eta_(\eta_ + \eta_)(\eta_ + \eta_) I_7 = (3 \eta_ - \eta_)(\eta_ + \eta_) \eta_ + \eta_)^2 - 3(\eta_ + \eta_)^2- (\eta_ - 3\eta_)(\eta_ + \eta_) (\eta_ + \eta_)^2 - (\eta_ + \eta_)^2 These are well-known as ''Hu moment invariants''. The first one, ''I''1, is analogous to the
moment of inertia The moment of inertia, otherwise known as the mass moment of inertia, angular mass, second moment of mass, or most accurately, rotational inertia, of a rigid body is a quantity that determines the torque needed for a desired angular accele ...
around the image's centroid, where the pixels' intensities are analogous to physical density. The first six, ''I''1 ... ''I''6, are reflection symmetric, i.e. they are unchanged if the image is changed to a mirror image. The last one, ''I''7, is reflection antisymmetric (changes sign under reflection), which enables it to distinguish mirror images of otherwise identical images. A general theory on deriving complete and independent sets of rotation moment invariants was proposed by J. Flusser.J. Flusser:
On the Independence of Rotation Moment Invariants
, Pattern Recognition, vol. 33, pp. 1405–1410, 2000.
He showed that the traditional set of Hu moment invariants is neither independent nor complete. ''I''3 is not very useful as it is dependent on the others (how?). In the original Hu's set there is a missing third order independent moment invariant: : I_8 = \eta_ ( \eta_ + \eta_)^2 - (\eta_ + \eta_)^2 - (\eta_-\eta_) (\eta_+\eta_) (\eta_+\eta_) Like ''I''7, ''I''8 is also reflection antisymmetric. Later, J. Flusser and T. SukJ. Flusser and T. Suk,
Rotation Moment Invariants for Recognition of Symmetric Objects
, IEEE Trans. Image Proc., vol. 15, pp. 3784–3790, 2006.
specialized the theory for N-rotationally symmetric shapes case.


Applications

Zhang et al. applied Hu moment invariants to solve the Pathological Brain Detection (PBD) problem. Doerr and Florence used information of the object orientation related to the second order central moments to effectively extract translation- and rotation-invariant object cross-sections from micro-X-ray tomography image data.


External links



University of Edinburgh

University of Edinburgh

Machine Perception and Computer Vision page (Matlab and Python source code)
Hu Moments
introductory video on YouTube
Gist
Implementation of this page, jupyter and python.


References

{{DEFAULTSORT:Image Moment Computer vision Digital imaging Image processing Moment (physics)